
import 'package:flutter/material.dart';
import 'package:flutter_demo/provider/active.dart';
import 'package:flutter_demo/utils/screen_size_fit.dart';
import 'package:provider/provider.dart';

import 'banner.dart';
import 'book.dart';

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage>{

  @override

  void initState() {
    super.initState();
    context.read<HomeProvider>().getActiveInfo();
  }

  Widget build(BuildContext context) {
    ScreenSizeFit(context);
    return Container(
        color: Color.fromRGBO(232,100,103,1),
          child: ListView(
            children: <Widget>[
              homeBanner(),
              books()
            ],
          )
      );
  }
}